import React from 'react';
import { Web3ReactProvider } from '@web3-react/core';
import { Web3Provider } from '@ethersproject/providers';
export type IWeb3ProvidersProps = {
  children: React.ReactNode;
};

const Web3Providers: React.FC<IWeb3ProvidersProps> = ({ children }) => {
//8.1版本没有 getLibrary 函数改用options={getLibrary}
  return <Web3ReactProvider getLibrary={(library) => new Web3Provider(library)}>{children}</Web3ReactProvider>;
};

export default Web3Providers;
